package cn.lili.eventbus;

import lombok.Data;

/**
 * @Author Sylow
 * @Description 事件基类
 * @Date: Created in 17:45 2025/6/12
 */
@Data
public abstract class BaseEvent {

    private final String eventType;

    private final long timestamp;

    // 新增受保护的无参构造
    protected BaseEvent() {
        this.eventType = "DEFAULT_EVENT"; // 或 null，根据业务决定
        this.timestamp = System.currentTimeMillis();
    }

    public BaseEvent(String eventType) {
        this.eventType = eventType;
        this.timestamp = System.currentTimeMillis();
    }


}
